home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 6
/
FM Towns Free Software Collection 6.iso
/
t_os
/
vdtwn
/
tvf
/
asmhd6
/
comdhd6
/
begin_n.asm
next >
Wrap
Assembly Source File
|
1993-07-08
|
3KB
|
222 lines
; window4 ASM
; 120h=vram
; 110h=egb
;
.386p
;G_BIOS equ 110h
;VRAM equ 120h
MOUSE equ fword ptr fs:[40h]
EGB equ fword ptr fs:[20h]
MOUSE1 equ fword ptr fs:[48h]
MB equ 0040h
code segment
assume cs:code,ds:code,gs:code,es:code,ss:code
org 0
start proc
lea eax,sz1
lea ecx,sz2
sub ecx,eax
inc ecx
mov file_byte,ecx
lea eax,sz1
mov bf_file,eax
lea eax,ds_name
mov ban_fname,eax
call filecreate
call writefile
call fileclose
owari:
mov ah,4ch
int 21h
sz1 label dword
cmp ah,0 ;ah=0 コマンドの張り付け
je link
cmp ah,2 ;システムの初期化
je syokika
cmp ah,4 ;window 内を通らなかった
je nagare
cmp ah,101 ;window が 特に何かをして欲しがっている
je tokuni
cmp ah,255 ;window 内を通って来た
ret
link:
call look_me
mov [esi],ecx
mov 4[esi],edx
ret
syokika:
mov bx,1632 ;画面16 16 or [1] or [33]
mov al,1 ;al=1 画面セット命令
mov ah,25
call komei ;koumei
mov al,0 ;セットした画面のカラー関係
mov ah,24
call komei ;koumei
; mov ah,6
; mov al,1
; mov edx,3
; call zzz
mov ah,2 ;mouse eraze
mov al,0
call MOUSE
; mov ah,0eh
; mov al,1
; call MOUSE
mov ah,25 ;screen cls
mov al,2
mov bx,0 ;screen no
call komei
mov ah,25 ;screen cls
mov al,2
mov bx,1 ;screen no
call komei
mov ah,2 ;mouse put
mov al,1
call MOUSE
ret
nagare:
cmp al,1
je short gare1
ret
gare1:
cmp ch,0
jne short gare2
ret
gare2:
ret
tokuni:
ret
sub_esi:
pop esi
ret
look_me:
call sub_esi
dd ? ;koumei の 番地
dd ? ;frontwork1
dw 0 ;wind need ( 1 = need 0 = no need )
dw ? ;wind no.
dw ? ;size x
dw ? ;size y
dw ? ; offset x
dw ? ; offset y
dw ? ; front color
dw ? ; back color
dw ?
zzz:
push edi
push esi
call look_me ;mov edi,bf_egb
mov esi,4[esi]
mov edi,20[esi]
pop esi
call EGB
pop edi
ret
komei:
push esi
call look_me
mov esi,[esi]
xchg esi,[esp]
ret
sz2 label dword
ds_name db '\KOMEI\実物\tvf_prg\begin',0
bf_file dd ?
file_byte dd ?
ban_fname dd ?
handle dw ?
ck_handle dw ?
fileopen:
mov ck_handle,0
mov ah,3dh
mov edx,ban_fname
mov al,2
int 21h
jc short cantopen
mov handle,ax
ret
cantopen:
cmp ax,2
je short filecreate
cantopen1:
mov ck_handle,1
ret
filecreate:
mov ck_handle,0
mov ah,3ch
mov edx,ban_fname
mov ecx,0
int 21h
jc cantopen1
mov handle,ax
ret
fileclose:
mov bx,handle
mov ah,3eh
int 21h
ret
readfile:
mov ck_handle,0
mov bx,handle
mov edx,bf_file
mov ecx,file_byte
mov ah,3fh
int 21h
jc cantopen1
ret
writefile:
mov ck_handle,0
mov bx,handle
mov edx,bf_file
mov ecx,file_byte
mov ah,40h
int 21h
jc cantopen1
ret
.stack 1400000
start endp
code ends
end start